home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 May: Tool Chest / Developer CD Series Tool Chest (Apple Computer)(May 1999).iso / Tool Chest / Development Kits / MPW etc / MPW-PR / MPW / Examples / SIOWExamples / Instructions < prev    next >
Encoding:
Text File  |  1998-12-10  |  4.1 KB  |  108 lines  |  [TEXT/MPS ]

  1. Instructions - The SIOW Example
  2.  
  3. Copyright Apple Computer, Inc. 1990, 1994, 1996
  4. All rights reserved.
  5.  
  6. About the Example
  7.  
  8.     SIOW (Simple Input/Output Window) is a package that enables a program
  9.     (C or Pascal), which does I/O in "glass teletype" fashion, to became a 
  10.     stand-alone application running in its own window.  The MPW 3.3 "Building
  11.     and Managing Programs in MPW" manual describes the behavior of such
  12.     applications in detail. (See the release notes for up-to-date info.)
  13.  
  14.     In brief, an input operation following a prompt will read only the 
  15.     characters that were actually typed or selected.  That is, the prompt 
  16.     is not read unless it is explicitly selected.  Most of the
  17.     items in the File, Edit, Font, and Size menus are available (not dimmed),
  18.     and operate as one would expect.
  19.  
  20.     The only example provided presently is a version of Count, derived from the
  21.     version to be found in CExamples. SIOW applications support drop-launching
  22.     similar to AppleScript "droplets" -- they can be launched by dragging 
  23.     files, folders, or disk icons onto the application icon in the 
  24.     finder, and the pathnames show up in the argc/argv parameter list
  25.     of the application's main() function.
  26.     
  27.     In this example, if Count is not drop-launched, then it interactively
  28.     gets a list of filenames from the user. In all cases it interactively
  29.     asks if a count of lines, characters, or both is desired, because
  30.     that kind of "command-line" option is not yet available in the argc/argv
  31.     parameter list.  In the version of Count in CExamples, all of this 
  32.     information is taken from the command line in MPW Shell.
  33.  
  34.     This example does not prompt the user to save the output. This was 
  35.     specified in the Make files by the rez option "-d DEFAULT_SAVE_PREF=1".
  36.     See SIOW.h for more information about controlling SIOW behavior via
  37.     preference resources.  Note also that if you choose Save near the
  38.     beginning of the program's execution, all the current output will
  39.     be saved, and all of the succeeding output will also be appended to
  40.     that file. Thus, even if the total output results in more text than can be
  41.     shown in the window (approx 32 KB), all of the output will be saved.
  42.  
  43. Building the Example
  44.  
  45.     If this example is not on your hard disk, copy its folder to
  46.     your hard disk.
  47.  
  48.     Set the default directory to "SIOWExamples". Depending on where the 
  49.     folder is located, this can be done by the command:
  50.         
  51.             Directory "{MPW}Examples:SIOWExamples:"
  52.             
  53.     Make sure your directory structure contains the following header files:
  54.  
  55.         ...:Interfaces:RIncludes:SIOW.h           # "{RIncludes}"
  56.         ...:Interfaces:RIncludes:SIOW.r           # "{RIncludes}"
  57.  
  58.     Make sure your directory structure contains the following library files:
  59.  
  60.         ...:Libraries:PPCLibraries:PPCSIOW.o    # "{PPCLibraries}"
  61.         ...:Libraries:Libraries:SIOW            # "{Libraries}"
  62.         ...:Libraries:Libraries:SIOW.far.o        # "{Libraries}"
  63.         ...:Libraries:Libraries:NuSIOW.o        # "{CFM68KLibraries}"
  64.  
  65.     You can build the example as a 'fat' application by executing one of the 
  66.     following commands (this utilizes the supplied Makefile):
  67.         
  68.         # this command line builds a "fat" app, consisting of both
  69.         # PowerPC and classic 68K executable.
  70.         
  71.         BuildProgram -e Count ∑∑ "{worksheet}"
  72.             
  73.     or
  74.  
  75.         # this command line builds a "fat" app, consisting of both
  76.         # PowerPC and CFM-68K executable.
  77.         
  78.         make -f Makefile.cfm68k Count.cfm68k -e > make.out 
  79.         make.out ∑∑ "{Worksheet}"
  80.  
  81. Launching the program
  82.  
  83.     Count can be launched from MPW as if it were a tool (with filename
  84.     arguments), or, alternatively, it can be launched from the Finder 
  85.     in the same way as any other application.
  86.  
  87.     Currently, pathnames can be provided to count by dragging files or
  88.     in the finder to drop-llaunch the Count application.  Up to 179 files have
  89.     been successfully dropped onto Count at one time -- this may be limited by heap
  90.     size, the current implementation of the Finder, or AppleEvent data-structures.
  91.  
  92. Example output:
  93.  
  94.     Command-line 
  95.         Count Count.c 
  96.     in MPW Shell, or by dropping Count.c onto the Count application in the Finder.
  97.  
  98.         Count
  99.             'HD:MPW:Examples:SIOWExamples:Count.c'
  100.         
  101.         Report desired (C[haracters], L[ines], B[oth]:b
  102.         
  103.           lines     chars filename
  104.             232      4668 HD:MPW:Examples:SIOWExamples:Count.c
  105.         
  106.         done
  107.  
  108.